DXL and Artisan Studio

To all,

Is there anyone who could help with a problem I am having when trying to automate Artisan Studio from DXL?

I cannot understand why the following DXL will not loop through all studio projects and display their names, I get similar problems if I try and connect to the 'Active Model' or get a handle to the 'Active Dictionary Item' via the 'Item' OLE method.

I used to be able to connect with Studio models when using Doors 8 - is there any one would would be able to test the following code in both versions and provide any help?

Studio Version 7.0.22 (patched to version 7.0f)
Doors Version 9.2.0.0

Many thanks in advance,
Paul.
// Create a connection with the standard Studio API
OleAutoObj myStudioApi = oleCreateAutoObject("OMTE.Projects");

// Loop through the projects
string oleCallResult = null;
oleCallResul = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)
{
errorBox ("ResetQueryItems Error : " oleCallResult);
}
else
{
bool moreProjects = false;
oleCallResult = null;
oleCallResult = oleMethod(myStudioApi, "MoreItems", null, moreProjects);
if (!null oleCallResult)
{
errorBox ("MoreItems Error : " oleCallResult);
}
else
{
while (moreProjects)
{
OleAutoObj aProject = null;
oleCallResult = oleMethod(myStudioApi, "NextItem", null, aProject);
if (!null oleCallResult)
{
errorBox ("NextItem Error : " oleCallResult);
}
else
{
infoBox(getProperty(aProject, "Name"));
}
}
}
}
Paul_Butcher - Fri Feb 05 08:55:02 EST 2010

Re: DXL and Artisan Studio
Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010

Did you notice the typo in your code?

string oleCallResult = null;
// "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call
oleCallResul = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)

 


Unfortunately you did not write what problems exactly you are experiencing so everbody without Artisan cannot help you.

 

Re: DXL and Artisan Studio
llandale - Sun Feb 07 02:59:39 EST 2010

Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010

Did you notice the typo in your code?

string oleCallResult = null;
// "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call
oleCallResul = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)

 


Unfortunately you did not write what problems exactly you are experiencing so everbody without Artisan cannot help you.

 

Compiler auto-declare is as useful as a hand-gun that auto-turns-off the safety when you pick it up. Its sole purpose is to let the user use a couple less key-strokes in a successful effort to make the code less understandable.

  • Louie

Re: DXL and Artisan Studio
Paul_Butcher - Mon Feb 08 04:51:47 EST 2010

Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010

Did you notice the typo in your code?

string oleCallResult = null;
// "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call
oleCallResul = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)

 


Unfortunately you did not write what problems exactly you are experiencing so everbody without Artisan cannot help you.

 

Thanks Mathias,

No - I hadn't spotted the typo. The 'resetQueryItems' method is now returning an error string.

Without Artisan installed I don't think engineers will be able to help with this one.

The problem I'm having is with the OMTE.Projects collection as every object method I call returns the error string 'OLE Problem : Failed to get iterator'. I can read the objects properties but not any of its associations.

Ultimately what I want to do it use own COM API to connect with Artisan Studio and return handles to certain model elements which the DXL will then process and creates as module objects. However if create an object of my own COM DLL Class, from DXL, and run any methods which interact with the OMTE.Projects collection I get the same error string 'OLE Problem : Failed to get iterator'. If I call the same COM object from a VB application it works perfectly when interacting the OMTE.Projects collection. Note that I had this all working with Doors 8.

I'd love to hear from anyone who is able to test the previously posted DXL script (with Mathias' corrections) using Doors 8 and 9 with Studio version 7.

Thanks again for your reply.
Paul.

Re: DXL and Artisan Studio
Paul_Butcher - Mon Feb 08 04:55:04 EST 2010

llandale - Sun Feb 07 02:59:39 EST 2010
Compiler auto-declare is as useful as a hand-gun that auto-turns-off the safety when you pick it up. Its sole purpose is to let the user use a couple less key-strokes in a successful effort to make the code less understandable.

  • Louie

Agreed! I'm assuming that there DXL does not provide a compiler switch to turn off the auto-declare?

Re: DXL and Artisan Studio
SystemAdmin - Mon Feb 08 05:26:21 EST 2010

Paul_Butcher - Mon Feb 08 04:55:04 EST 2010
Agreed! I'm assuming that there DXL does not provide a compiler switch to turn off the auto-declare?

Look at the following post:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14230157&#14230157

Re: DXL and Artisan Studio
Paul_Butcher - Mon Feb 08 05:41:25 EST 2010

SystemAdmin - Mon Feb 08 05:26:21 EST 2010
Look at the following post:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14230157&#14230157

Thanks.

Re: DXL and Artisan Studio
Paul_Butcher - Mon Feb 08 05:43:44 EST 2010

// Create a connection with the standard Studio API
OleAutoObj myStudioApi = oleCreateAutoObject("OMTE.Projects");
 
// Loop through the projects
string oleCallResult = null;
oleCallResult = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)
{
  errorBox ("ResetQueryItems Error : " oleCallResult);
}
else
{
  bool moreProjects = false;
  oleCallResult = null;
  oleCallResult = oleMethod(myStudioApi, "MoreItems", null, moreProjects);
  if (!null oleCallResult)
  {
    errorBox ("MoreItems Error : " oleCallResult);
  }
  else
  {
    while (moreProjects)
    {
      OleAutoObj aProject = null;
      oleCallResult = oleMethod(myStudioApi, "NextItem", null, aProject);
      if (!null oleCallResult)
      {
        errorBox ("NextItem Error : " oleCallResult);
      }
      else
      {
        infoBox(getProperty(aProject, "Name"));
      }
    }
  }
}

Re: DXL and Artisan Studio
Paul_Butcher - Mon Feb 08 06:45:12 EST 2010

Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010

Did you notice the typo in your code?

string oleCallResult = null;
// "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call
oleCallResul = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)

 


Unfortunately you did not write what problems exactly you are experiencing so everbody without Artisan cannot help you.

 

Hi Mathias,

I think I may be able to explain the problem better using an example from the DXL reference.
 

OleAutoObj  objExcel = oleCreateAutoObject("Excel.Application") 
OleAutoObj  objWorkbooks 
OleAutoObj  objSpreadSheet 
OleAutoArgs autoArgs  = create 
bool        excelVisible = false 
string      result 
 
/* Make Excel visible to the user */ 
oleGet(objExcel, "Visible", excelVisible) 
if (!excelVisible) 
    olePut(objExcel,"Visible", true) 
 
/* Add new workbook */ 
oleGet(objExcel,"Workbooks", objWorkbooks) 
oleMethod(objWorkbooks,"Add") 
put(autoArgs, "Sheet1") 
 
/* Add new worksheet and activate it */ 
oleMethod(objExcel,"Sheets", autoArgs,
           objSpreadSheet) 
 
if (!null objSpreadSheet)
{
   infoBox ("Navigated an association!");
} 
else
{
    errorBox("Failed to navigate an association!");
}

Re: DXL and Artisan Studio
Paul_Butcher - Mon Feb 08 11:01:54 EST 2010

Paul_Butcher - Mon Feb 08 06:45:12 EST 2010

Hi Mathias,

I think I may be able to explain the problem better using an example from the DXL reference.
 

OleAutoObj  objExcel = oleCreateAutoObject("Excel.Application") 
OleAutoObj  objWorkbooks 
OleAutoObj  objSpreadSheet 
OleAutoArgs autoArgs  = create 
bool        excelVisible = false 
string      result 
 
/* Make Excel visible to the user */ 
oleGet(objExcel, "Visible", excelVisible) 
if (!excelVisible) 
    olePut(objExcel,"Visible", true) 
 
/* Add new workbook */ 
oleGet(objExcel,"Workbooks", objWorkbooks) 
oleMethod(objWorkbooks,"Add") 
put(autoArgs, "Sheet1") 
 
/* Add new worksheet and activate it */ 
oleMethod(objExcel,"Sheets", autoArgs,
           objSpreadSheet) 
 
if (!null objSpreadSheet)
{
   infoBox ("Navigated an association!");
} 
else
{
    errorBox("Failed to navigate an association!");
}

Scratch that last post... the DXL was for a version of Excel earlier than Excel version 2007.

Re: DXL and Artisan Studio
Paul_Butcher - Fri Feb 12 04:55:35 EST 2010

Atego \ Artisan have explained the problem...

"Unlike the previous version, DOORs 2009 now uses a library called libeay32.dll which is also used by Artisan Studio (the Enabler software, to be more precise). Unfortunately, the two products use incompatible versions of this dll, and they cannot be interchanged. This does not normally cause any problems to either tool, but if you load the Studio Automation object into the DOORs process (as you do from your DXL) Windows attempts to reuse the loaded dll which then causes an error because it is not compatible with the one Studio needs."

I'm thinking that the only answer is to write the entire application outside of DXL and then send DXL snippets into Doors.

Re: DXL and Artisan Studio
Mathias Mamsch - Fri Feb 12 05:38:33 EST 2010

Paul_Butcher - Fri Feb 12 04:55:35 EST 2010
Atego \ Artisan have explained the problem...

"Unlike the previous version, DOORs 2009 now uses a library called libeay32.dll which is also used by Artisan Studio (the Enabler software, to be more precise). Unfortunately, the two products use incompatible versions of this dll, and they cannot be interchanged. This does not normally cause any problems to either tool, but if you load the Studio Automation object into the DOORs process (as you do from your DXL) Windows attempts to reuse the loaded dll which then causes an error because it is not compatible with the one Studio needs."

I'm thinking that the only answer is to write the entire application outside of DXL and then send DXL snippets into Doors.

Hmm thats a tough one.

One way to resolve this would be to patch DOORS.exe to rename the library in the import section. You could replace the "libeay32.dll" string by "libeayXX.dll" and rename the dll file. This way you would resolve the version abiguity - but it would be hard to roll out a change like that.

There might be another way to help you with that. Windows XP implemented several mechanisms to get out of DLL Hell. You might want to read this MSDN page.

http://msdn.microsoft.com/en-us/library/ms811700.aspx

Cite:
DLL/COM Redirection

DLL/COM redirection requires that when the application is deployed, the application executable and all isolated components be installed into the application directory rather than the system directory. Additionally, a ".local" file is deployed to the application directory to modify the Windows binding behavior, so that the application binds to the isolated components rather than the globally shared version.

Thus, the application will use a component that can run safely side by side with a different version of the same component that is installed elsewhere, in another application directory or in the system directory. If another application on the system requires a different version, your application is unaffected and both applications will run with their respective versions of the component.


I am not 100% sure, but I bet it is possible to tell windows not to reuse the same DLL.

Regards, Mathias